<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <select>
    <option value="1">上海</option>
    <option value="2">北京</option>
    <option value="3">河北</option>
  </select>

  <!-- 需求: 选择完城市后 要获取选中了谁 -->
  <!-- select下拉框 选中的value值 是 选中的option的value -->
  <script>
      const select = document.querySelector('select')
      select.onchange = () => {
        console.log(select.value)
      }
  </script>
</body>
</html>